from turbogears import validators as v


class EventFormSchema(v.Schema):
    
    event_name = v.UnicodeString(
        not_empty=True,
        max=50,
        strip=True)
    start_date = v.DateTimeConverter()
    end_date = v.DateTimeConverter()
    description = v.UnicodeString(not_empty=True)
    home_page = v.URL(add_http=True)


class RegistrationFormSchema(v.Schema):

    user_name = v.UnicodeString(
        not_empty=True,
        max=50,
        strip=True)
    display_name = v.UnicodeString(
        not_empty=True,
        max=20,
        strip=True) 
    first_name = v.UnicodeString(
        not_empty=True,
        max=50,
        strip=True)
    last_name = v.UnicodeString(
        not_empty=True,
        max=50,
        strip=True)
    email_address = v.Email(
        not_empty=True, 
        max=255, 
        strip=True)
    password = v.UnicodeString(max=50)
    password_confirm = v.UnicodeString(max=50)
    chained_validators = [v.FieldsMatch('password', 'password_confirm')]
    